<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<style>
			
		</style>
		<div class="super-theme-example">
			<div class="options-toolbar">
				<form id="feedbackDatagridQueryParams">
					<select id="feedbackShopIdCombo" class="easyui-combobox" name="shopId" style="width:150px;"></select>
					<input id="feedback-datepicker" class="datepicker-input" />
					<input class="easyui-textbox" name="tel" data-options="width:120,prompt:'电话号码'">
					<a href="javascript:void(0)" class="easyui-linkbutton primary" data-options="iconCls:'fa fa-search'" onclick="feedback.methods.queryDatagrid();">查询</a>
				</form>
			</div>
			<table id="feedback-datagrid"></table>
		</div>
		<script src="dists/wangEditor/release/wangEditor.js"></script>
		<script type="text/javascript" src="dists/plupload-2.3.6/js/plupload.full.min.js"></script>
		<script type="text/javascript" src="dists/plupload-2.3.6/js/i18n/zh_CN.js"></script>
		<script type="text/javascript">
			var feedback = {
				datas : {} ,
				methods : {
					initShopCombo: function(){
						$('#feedbackShopIdCombo').combobox({
						    url: commonConfig.shopUrlPrefix() + '/shop/combobox',
						    valueField: 'id',
						    textField: 'text'
						});
					},
					initTimeSelect: function(){
						$('#feedback-datepicker').daterangepicker($.extend(true, {} , globalDaterangepickerOptions));
					},
					initDatagridQueryParams: function(){
						var params = $('#feedbackDatagridQueryParams').serializeArray();
						var queryParams = {};
						$.each(params , function(index , param){
						     queryParams[param.name] = param.value;
						})
						var time = $('#feedback-datepicker').val();
						queryParams.begainTime = timestamp(time.substring(0, 19));
						queryParams.endTime = timestamp(time.substring(22));
						return queryParams;
					},
					initDatagrid : function(){
						$('#feedback-datagrid').datagrid({
							height: $(document).height() - 200,
						    url: commonConfig.shopUrlPrefix() + '/shop/feedback',
						    queryParams: {
								begainTime: timestamp($('#feedback-datepicker').val().substring(0, 19)),
								endTime: timestamp($('#feedback-datepicker').val().substring(22))
							},
						    columns:[[
								{field:'id',title:'编号',width:100,align:'center'},
								{field:'shopName',title:'商城',width:100,align:'center'},
								{field:'tel',title:'电话',width:150,align:'center'},
								{field:'feedback',title:'反馈内容',width:800,align:'center'},
								{field:'createdAt',title:'时间',width:150,align:'center'}
								
						    ]]
						});
					},
					queryDatagrid: function(){
						$('#feedback-datagrid').datagrid('load',feedback.methods.initDatagridQueryParams());
					}
				},
				init : function(){
					feedback.methods.initShopCombo();
					feedback.methods.initTimeSelect();
					feedback.methods.initDatagrid();
				}
			}
			feedback.init();
		</script>
	</body>
</html>
